package bk.ss;

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class Day06Test1 extends Applet implements MouseListener{

	/**
	 * @param args
	 */
    private int x, y;                        // the dot's coordinates

    public void init( )
    {
        setSize(300, 300);
        setBackground(Color.yellow);
        setForeground(Color.red);
        x = 150;
        y = 150;
        addMouseListener(this);  // register itself as the mouse listener
    }
    public void paint(Graphics g)
    {
        // display the dot
        g.fillOval(x-5, y-5, 10, 10);
    }

    // implements the mouse listener interface to respond to
    // mouse clicked event
    public void mouseClicked(MouseEvent event)
    {
        // set x, y to the mouse's position
        x = event.getX( );
        y = event.getY( );

        // call repaint to redisplay the applet (repaint will call paint)
        repaint( );
    }
    public void mousePressed(MouseEvent event)  { }
    public void mouseReleased(MouseEvent event)  { }
    public void mouseEntered(MouseEvent event)  { }
    public void mouseExited(MouseEvent event)  { }

	
}
